package me.spring.cloud.common.components.rpc.page;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 带分页的列表
 *
 * @author luffy
 * @date 2018/7/18
 */
@Data
public class PageResultList<T> implements Serializable {

    private static final long serialVersionUID = -8698154914620531802L;

    private PageResult resultPage;

    private List<T> data;

    public PageResultList(Page page, Long totalCount, Integer totalPage, List<T> data) {
        this.resultPage = new PageResult(page);
        this.resultPage.setTotalCount(totalCount);
        this.resultPage.setTotalPage(totalPage);
        this.resultPage.setMore(this.resultPage.getPageIndex() < this.resultPage.getTotalPage());
        this.data = data;
    }
}